<template>
    <!-- 折叠面板 -->
    <el-collapse v-model="collapseName">
        <el-collapse-item title="通用样式" name="1">

            <div v-if="ItemInfo.style.left">
                <p class="tab_title">X坐标</p>
                <div>
                    <el-input-number v-model="ItemInfo.style.left" controls-position="right" size="small" />
                </div>
            </div>

            <div v-if="ItemInfo.style.top">
                <p class="tab_title">Y坐标</p>
                <div>
                    <el-input-number v-model="ItemInfo.style.top" controls-position="right" size="small" />
                </div>
            </div>

            <div v-if="ItemInfo.style.rotate">
                <p class="tab_title">旋转角度</p>
                <div>
                    <el-input-number v-model="ItemInfo.style.rotate" controls-position="right" size="small" />
                </div>
            </div>

            <div v-if="ItemInfo.style.width">
                <p class="tab_title">宽</p>
                <div>
                    <el-input-number v-model="ItemInfo.style.width" controls-position="right" size="small" />
                </div>
            </div>

            <div v-if="ItemInfo.style.height">
                <p class="tab_title">高</p>
                <div>
                    <el-input-number v-model="ItemInfo.style.height" controls-position="right" size="small" />
                </div>
            </div>

            <div v-if="ItemInfo.style.color" class="demo-color-block">
                <span class="demonstration">颜色</span>
                <el-color-picker v-model="ItemInfo.style.color" />
            </div>

            <div v-if="ItemInfo.style.background" class="demo-color-block">
                <span class="demonstration">背景色</span>
                <el-color-picker v-model="ItemInfo.style.background" />
            </div>

            <div v-if="ItemInfo.propLable" class="demo-color-block">
                <p class="tab_title">内容</p>
                <el-input v-model="ItemInfo.propLable" :rows="3" type="textarea" />
            </div>

            <!-- <div class="demo-color-block">
                <span class="demonstration">边框颜色</span>
                <el-color-picker />
            </div> -->
        </el-collapse-item>
    </el-collapse>
</template>

<script setup>
import { ref, watch } from 'vue'
import { userToolbarStore } from '../../store'


const store = userToolbarStore()
const ItemInfo = ref({
    style: {}
})
const collapseName = ref('1')

watch(store, (newVal) => {
    ItemInfo.value = newVal.styleItem
})
</script>

<style scoped>
.tab_title {
    margin-bottom: 20px !important;
}
</style>